package org.example;

class ExploitChallenge implements CodeChallenge {
    private String description;

    public ExploitChallenge(String desc) {
        this.description = desc;
    }

    @Override
    public String getDescription() {
        return "【渗透挑战】\n" + description + "\n实现要求:\n" +
                "1. 创建缓冲区溢出\n" +
                "2. 注入shellcode\n" +
                "3. 获取系统权限";
    }

    @Override
    public String getHint() {
        return "使用ByteBuffer和native方法";
    }

    @Override
    public boolean validateSolution(String code) {
        return code.contains("ByteBuffer") &&
                code.contains("native") &&
                code.contains("exec(");
    }
}
